javax.realtime
Class HeapMemory

java.lang.Object
  extended byjavax.realtime.MemoryArea
      extended byjavax.realtime.HeapMemory

public final class HeapMemory
extends MemoryArea

The HeapMemory class is a singleton object that allows logic with a non-heap allocation context to allocate objects in the Java heap.


Field Summary
 
Fields inherited from class javax.realtime.MemoryArea
logic, sizeEstimator, sizeInBytes
 
Constructor Summary
HeapMemory()
          Constructor.
 
Method Summary
 void executeInArea(java.lang.Runnable logic)
          Execute the run method from the logic parameter using heap as the current allocation context.
static HeapMemory instance()
          Returns a reference to the singleton instance of HeapMemory representing the Java heap.
 
Methods inherited from class javax.realtime.MemoryArea
enter, enter, getMemoryArea, memoryConsumed, memoryRemaining, newArray, newInstance, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeapMemory

public HeapMemory()
Constructor.

Not currently implemented

Method Detail

instance

public static HeapMemory instance()
Returns a reference to the singleton instance of HeapMemory representing the Java heap. The singleton instance of this class shall be allocated in the ImmortalMemory area.

Not currently implemented

Returns:
The singleton HeapMemory object.

executeInArea

public void executeInArea(java.lang.Runnable logic)
Execute the run method from the logic parameter using heap as the current allocation context. For a schedulable object, this saves the current scope stack and replaces it with one consisting only of the HeapMemory instance; restoring the original scope stack upon completion.

Not currently implemented

Overrides:
executeInArea in class MemoryArea
Parameters:
logic - The runnable object whose run() method should be executed.
Throws:
java.lang.IllegalArgumentException - Thrown if logic is null.